package org.paradise.dms.web.action.hall;

import java.util.List;

import net.sf.json.JSONArray;

import org.apache.struts2.ServletActionContext;
import org.directwebremoting.annotations.RemoteProxy;
import org.paradise.dms.pojo.AllocationInfo;
import org.paradise.dms.pojo.Hall;
import org.paradise.dms.services.BuildingsMgrService;
import org.paradise.dms.services.HallService;
import org.paradise.dms.web.action.DMSBaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 大厅的功能:在调换宿舍的时候,可先将某个已经分配宿舍的人放入大厅,再将已保留在大厅中的他重新分配宿舍,大厅实际起提示的作用,
 * 避免把某人退宿后忘了重新分配宿舍
 * @author kevin
 *
 */
@Service
@RemoteProxy(name = "hallAction")
public class HallAction extends DMSBaseAction{
	@Autowired
	private HallService hallService;

	
	/**
	 * 
	 * @return
	 */
	public JSONArray getAllPersonInHall() {
		List hallList = hallService.getAllPersonInHall();
		JSONArray allocationlist = new JSONArray().fromObject(hallList);
		return allocationlist;
	}
	public String deleteHallItem(int hallId){
		return hallService.deleteHallItem(hallId);
	}

	public String intoHall(int studentid){
		return hallService.intoHall(studentid);
	}
}
